Skip to content

ci: enforce the local verify:cheap gate set in CI + gate-manifest self-test (maturity L3)#1002

Merged
BigSimmo merged 5 commits into
mainfrom
claude/maturity-l3-gate-manifest
Jul 20, 2026
Merged

ci: enforce the local verify:cheap gate set in CI + gate-manifest self-test (maturity L3)#1002
BigSimmo merged 5 commits into
mainfrom
claude/maturity-l3-gate-manifest

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

Maturity backlog L3 (single gate manifest). While scoping it I found a concrete gap: three gates ran in the local verify:cheap chain but in no workflow at all, so a regression they catch would merge green because the CI pr-required aggregate never ran them:

  • sitemap:check (site-map drift)
  • check:therapy-data-index (therapy-index drift)
  • check:design-system-contract (design-system contract)

This is the same class of miss the static-pr job already documents in a comment — it records the type/icon/brand guards being promoted into CI after they drifted green as local-only checks. These three are one iteration later.

  • Close the gap: add the three drift detectors to the static-pr job (all three pass on current main — verified before adding, so CI stays green).
  • Prevent recurrence: add scripts/check-gate-manifest.mjs — a self-test asserting every verify:cheap:internal gate is enforced in CI (in static-pr, or via an explicit mapping for testtest:coverage in the coverage job). Wired into both verify:cheap:internal and the static-pr job, so a gate added to the local chain can no longer be silently missed in CI. The mapping/exemption tables are explicit and commented, so any future asymmetry is a conscious, reviewed edit.

Direction is intentionally one-way: CI may run more than the local chain (e.g. format:check, build/e2e in other jobs); it must never run less of the local static set.

Diff: 3 files+scripts/check-gate-manifest.mjs (87), .github/workflows/ci.yml (+17, four steps), package.json (+1 script, wired into verify:cheap:internal).

Verification

  • npm run check:gate-manifestpass ("all 20 verify:cheap gates are enforced in CI"). Negative test: before adding the three CI steps it failed with exactly those three gates named — proving it catches the regression.
  • npm run sitemap:check, npm run check:therapy-data-index, npm run check:design-system-contract — all pass on main (safe to enforce in CI).
  • npm run check:ci-scope, npm run check:ci-triage, npm run check:pr-policy, npm run check:github-actions — pass (CI-structure self-tests unaffected; no new actions added).
  • npm run check:runtime — pass; eslint on the new script — clean; npm run format:check — pass.
  • Not run: the full verify:cheap (its test step is the slow vitest run) — the change adds gates and a manifest check, it doesn't alter any existing gate's behaviour.

Risk and rollout

  • Risk: low-medium — a CI/config change. The three added CI steps are cheap, deterministic, offline drift-detectors already green on main; the self-test is additive. The main watch-point is that the three checks must stay green in CI (they are on main).
  • Rollback: revert the PR (removes the three steps + the self-test; no runtime/app effect).
  • Provider or production effects: None — no live services touched.

Clinical Governance Preflight

N/A — CI/tooling change only; no ingestion, answer generation, search/ranking, source rendering, document access, privacy, production-env, or clinical-output behaviour changed.

Notes

Completes L3 from docs/maturity-backlog-workorders.md. The self-test's CI_EQUIVALENT / LOCAL_ONLY tables are the documented seam for any future intentional asymmetry between the local and CI gate sets.


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved CI validation to detect missing or outdated quality checks.
    • Enforced consistency between locally defined gate checks and those run in CI.
    • Added CI drift detection for site map, therapy data index, and design-system contract outputs.
  • Chores
    • Added a new gate-manifest validation script to ensure local verification steps are mirrored in CI.

…f-test (maturity L3)

Three gates ran in the local `verify:cheap` chain but in NO workflow —
`sitemap:check`, `check:therapy-data-index`, `check:design-system-contract` —
so a site-map, therapy-index, or design-system-contract regression merged green
(the CI aggregate never ran them). This is the same class of miss the static-pr
job already documents for the type/icon/brand guards.

- Add the three drift detectors to the static-pr job (all pass on main).
- Add scripts/check-gate-manifest.mjs: a self-test asserting every
  `verify:cheap:internal` gate is enforced in CI (in static-pr, or via an
  explicit mapping for `test` -> `test:coverage` in the coverage job), so a gate
  added to the local chain can no longer be silently missed in CI. Wired into
  both `verify:cheap:internal` and the static-pr job.

Verified: `check:gate-manifest` passes; before the fix it failed on exactly the
three drifted gates (proving it catches the regression); ci-scope / ci-triage /
pr-policy / github-actions self-tests, eslint, and prettier all green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Jc1ZYHFjXjn6mE6U6riVU
@supabase

supabase Bot commented Jul 20, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5ecdc864-7fe9-4773-bdaf-3b4a725d2849

📥 Commits

Reviewing files that changed from the base of the PR and between 898e61d and bb58428.

📒 Files selected for processing (1)
  • package.json

📝 Walkthrough

Walkthrough

The PR adds a gate-manifest CLI that compares local verification scripts with CI commands, exposes it through npm scripts, and runs it alongside sitemap, therapy data index, and design-system contract checks in the static-pr job.

Changes

CI gate enforcement

Layer / File(s) Summary
Gate manifest checker
package.json, scripts/check-gate-manifest.mjs
Adds the gate-manifest npm script and a CLI that detects missing CI enforcement, supports equivalence mappings and local-only gates, and reports drift with a failing exit code.
Static PR check integration
.github/workflows/ci.yml
Runs the gate-manifest self-test and adds sitemap, therapy data index, and design-system contract drift checks to static-pr.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the CI gate enforcement and new gate-manifest self-test.
Description check ✅ Passed The description covers Summary, Verification, Risk and rollout, Clinical Governance, and Notes, with only minor template items left implicit.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/maturity-l3-gate-manifest

Comment @coderabbitai help to get the list of available commands.

@BigSimmo
BigSimmo marked this pull request as ready for review July 20, 2026 18:42
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 20, 2026 18:42
@BigSimmo
BigSimmo disabled auto-merge July 20, 2026 18:43

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/check-gate-manifest.mjs`:
- Around line 35-36: Update the line parsing in the manifest-checking logic
around the scripts extraction and static-pr gate extraction to ignore YAML
comments and match only actual, line-anchored run fields. Require the expected
YAML indentation and field structure before capturing script or gate names,
while preserving the existing collection behavior for valid CI steps.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 08aac9b2-897f-47ce-b015-e686fb142d17

📥 Commits

Reviewing files that changed from the base of the PR and between adefc0e and 9a20d5b.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • package.json
  • scripts/check-gate-manifest.mjs

Comment thread scripts/check-gate-manifest.mjs Outdated
claude and others added 2 commits July 20, 2026 18:49
The npm-run extraction regexes were unanchored, so a YAML comment that merely
mentioned `run: npm run X` counted as an executed CI gate — which would let the
drift check pass after the real step had been deleted, defeating the guard.
Parse line-anchored `run:` fields only, via a shared npmRunScript() helper
(a trailing `# comment` on a real step is still allowed).

Verified: the self-test still reports all 20 gates enforced; the negative drift
test still fires when a step is removed; and a comment line mentioning
`run: npm run test:coverage` now correctly yields no gate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Jc1ZYHFjXjn6mE6U6riVU
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 20, 2026 20:56
@BigSimmo
BigSimmo merged commit 2f31b2c into main Jul 20, 2026
18 checks passed
@BigSimmo
BigSimmo deleted the claude/maturity-l3-gate-manifest branch July 20, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants